#ifndef __PROTOCOL_H
#define __PROTOCOL_H

#define BYTE0(dwTemp)       ( *( (char *)(&dwTemp)    ) )
#define BYTE1(dwTemp)       ( *( (char *)(&dwTemp) + 1) )
#define BYTE2(dwTemp)       ( *( (char *)(&dwTemp) + 2) )
#define BYTE3(dwTemp)       ( *( (char *)(&dwTemp) + 3) )

#define PULSE_TARGET        0x01
#define POSTURE_TARGET      0x02
#define PULSE_RESET         0x04
#define REQ_ADC             0x08
#define MAX_SPEED           0x10
#define MAX_ACC             0x20
#define REQUIRE             0x80

typedef unsigned char u8;
typedef unsigned short u16;
typedef short int s16;

extern u8 Fcn;
extern u8 RxTemp[12];
extern u8 RcvCnt;

u8 Data_Receive_Precess(u8 RxData);
u8 Send_u16_data(u16 *data, u8 fcn, u8 len, void(*Send_Fcn)(u8 *data, u8 len));
u8 Send_u8_data(u8 data, u8 fcn, void(*Send_Fcn)(u8 *data, u8 len));

#endif
